using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Calc
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //var text = "9+(3-1)*3+10/2";
            var caculator = new Caculator();

            var text = Console.ReadLine();
            while(text != "q")
            {
                Console.WriteLine(caculator.Eval(text));
                text = Console.ReadLine();
            }

            //9
            
        }
    }
}